package com;

import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Random;
/**
 * aiguoxin 2010-10-20下午01:35:13
 * 
 * 随机数产生总结
 */
public class RandomNum {
	public static void main(String[] args) {
		/*// Math.random()方法
		for (int i = 0; i < 10; i++) {
			System.out.print((int)(Math.random()*1000) + " ");
		}		System.out.println("/n" + "-----------------------------");
		// 不带种子，每次的随机数不同
		Random rand = new Random();
		for (int i = 0; i < 10; i++) {
			System.out.print(rand.nextInt(100) + " ");
		}
		System.out.println("/n" + "-----------------------------");
		// 带种子，每次的随机数相同
		Random rand2 = new Random(10);
		for (int i = 0; i < 10; i++) {
			System.out.print(rand2.nextInt(100) + " ");
		}
		
		System.out.println("/n" + "-----------------------------");
		// 生成完全不重复的随机数
		SecureRandom random = new SecureRandom();*/
		
	/*	for (int i = 0; i < 10; i++) {
			System.out.print(random.nextInt(100) + " ");*/
			String zhang = "zz.zz";
			String a[];
			System.out.print(zhang.indexOf("."));
			a = zhang.split(".");
			System.out.print(a[0]);
		//}
	}
}